package cate.game.role.friend.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBFriend;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "搜索好友 の 请求")
public class FriendSearchReq implements MsgInput {
    @NoteField(value = "好友名字")
    public String name;

    /**
     * 根据名字搜索玩家
     */
    @Override
    public void execute(GameBody game, ClientContext cc) {
        cc.getRole().getFriend().search(name, cc.getRole().getUid());
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBFriend.SEARCH_REQ;
    }
}
